package com.wg.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wg.common.constant.UserConstants;
import com.wg.system.entity.SysDictData;

import java.util.List;

/**
 * 字典数据表(SysDictData)数据库访问层
 *
 * @author wg
 * @date 2022-04-26 21:22:26
 */
public interface SysDictDataMapper extends BaseMapper<SysDictData> {

    default List<SysDictData> selectDictDataByType(String dictType) {
        return selectList(
                new LambdaQueryWrapper<SysDictData>()
                        .eq(SysDictData::getStatus, UserConstants.DICT_NORMAL)
                        .eq(SysDictData::getDictType, dictType)
                        .orderByAsc(SysDictData::getDictSort));
    }
}


